using System;
using System.IO;
using System.Windows;

namespace Qplus.Commands
{

    /**
     * command:RegMachine
     * 	UserID：用户ID
     *	APPID：应用ID
     *	PhoneType：手机型号
     *	Platform：手机平台
     *	IMSI：国际移动用户识别码
     *	IMEI：国际移动设备识别码
     * @author Administrator
     *
     */
    public class RegMachineCommand : AbsHeaderHttpCommand , HttpInputStreamProcessor{

	    const String COMMAND = "RegMachine";
	
	    public RegMachineCommand(String uid, String UKEY)
            : base(COMMAND, uid, UKEY)
        {
		    
	    }
	
	    /**
	     * 设置请求参数
	     * @param userID 用户id
	     * @param phoneType 手机型号
	     * @param appID 应用id
	     * @param platform 手机平台
	     * @param imsi imsi国际移动用户识别码
	     * @param imei imei国际移动设备识别码
	     */
	    public void set(long userID, String phoneType, String appID, String platform, String imsi, String imei){
		    setUserID(userID);
		    setPhoneType(phoneType);
		    setAPPID(appID);
		    setIMEI(imei);
		    setIMSI(imsi);
		    setPlatform(platform);
	    }
	
	    public void setUserID(long userID){
		    addParams("UserID", userID);
	    }
	
	    public void setPhoneType(String PhoneType){
		    addParams("PhoneType", PhoneType);
	    }
	
	    public void setAPPID(String APPID){
		    addParams("APPID", APPID);
	    }
	
	    public void setPlatform(String Platform){
		    addParams("Platform", Platform);
	    }
	
	    public void setIMSI(String IMSI){
		    addParams("IMSI", IMSI);
	    }
	
	    public void setIMEI(String IMEI){
		    addParams("IMEI", IMEI);
	    }
	
	    /**
	     * 执行注册设备任务
	     * @param context
	     * @param url
	     * @return
	     */
	    public HttpTask execute(String url) {
		    return base.execute(url, this);
   
	    }

	    
	    public override Boolean processInputStream(Stream responseStream) {
		    return true;
	    }

	    public void onSuccess(int code){
		   
	    }

	    public void onFailed(int code){
		    
	    }
    }
}